<?php
namespace app\admin\service;

use app\admin\logic\Banner;

class BannerService extends BaseService
{

    /**
     * 添加banner
     *
     * @param $data
     *
     * @return false|int
     */
    public function createBanner($data){
        $bannerLogic = new Banner();
        return $bannerLogic->addBanner($data);
    }

    /**
     * 获取banner列表
     *
     * @param $where
     * @param $order
     * @param $page_data
     *
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getBannerList($where,$order,$page_data){
        $bannerLogic = new Banner();
        return $bannerLogic->getBannerList($where,$order,$page_data);
    }

    /**
     * 根据ID查询banner数据
     *
     * @param $id
     *
     * @return mixed
     */
    function findBannerById($id){
        $bannerLogic = new Banner();
        return $bannerLogic->getBannerInfo($id);
    }

    /**
     * 根据ID删除数据
     *
     * @param $id
     *
     * @return int
     */
    function deleteById($id){
        $bannerLogic = new Banner();
        return $bannerLogic->deleteById($id);
    }
}